/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package suministros.ejb30.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author CAROLINA
 */
@Embeddable
public class HistorialCargosPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "cod_Historial_Cargo")
    private String codHistorialCargo;
    @Basic(optional = false)
    @Column(name = "DNI")
    private String dni;

    public HistorialCargosPK() {
    }

    public HistorialCargosPK(String codHistorialCargo, String dni) {
        this.codHistorialCargo = codHistorialCargo;
        this.dni = dni;
    }

    public String getCodHistorialCargo() {
        return codHistorialCargo;
    }

    public void setCodHistorialCargo(String codHistorialCargo) {
        this.codHistorialCargo = codHistorialCargo;
    }

    public String getDni() {
        return dni;
    }

    public void setDni(String dni) {
        this.dni = dni;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codHistorialCargo != null ? codHistorialCargo.hashCode() : 0);
        hash += (dni != null ? dni.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistorialCargosPK)) {
            return false;
        }
        HistorialCargosPK other = (HistorialCargosPK) object;
        if ((this.codHistorialCargo == null && other.codHistorialCargo != null) || (this.codHistorialCargo != null && !this.codHistorialCargo.equals(other.codHistorialCargo))) {
            return false;
        }
        if ((this.dni == null && other.dni != null) || (this.dni != null && !this.dni.equals(other.dni))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "suministros.ejb30.entity.HistorialCargosPK[codHistorialCargo=" + codHistorialCargo + ", dni=" + dni + "]";
    }

}
